<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>处方详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weui.css" />
    <link rel="stylesheet" href="/lobsteruiframe/weui/css/weuix.css" />
    <script src="/lobsteruiframe/weui/js/zepto.min.js"></script>
    <script src="/lobsteruiframe/weui/js/zepto.weui.js"></script>
    <script src="/lobsteruiframe/weui/js/swipe.js"></script>
    <script src="/lobsteruiframe/weui/js/macy.js"></script>
    <script src="/jslib/lobster.js"></script>
    <script src="/jslib/template-web.js"></script>

    <style>

    </style>
</head>

<body ontouchstart>
    <div class="container">
        <div class="page-hd">
            <h1 class="page-hd-title" style="text-align:center;">处方明细</h1>
        </div>
        <div class="page-bd" id="div_content">

        </div>
        <div class="weui-loadmore">
                <i class="weui-loading"></i>
                <span class="weui-loadmore__tips">正在加载</span>
            </div>
    </div>
</body>

</html>

<script>
    lobsterh5.main({
        data: {
            repno: "",

        },
        pageload() {
            var self = this;
            self.data.repno = lobsterh5.GetUrlParam("repno");
            self.initdata();
            self.initevent();
        },

        initevent() {
            var self = this;
        },
        initdata() {
            var self = this;
            var list = [];
            
            var data ={
                repno:self.data.repno
            };
            lobsterh5.GETAPI("tsselfpay.getPresDetail", data).then(res => {
                 console.log(res);
                 $(".weui-loadmore").hide();
                 self.showdata(res);
            }).catch(res => {
                console.log(res);
            })

           
        },
        showdata(res){
            var self = this;
            self.inittemp("tplrecord", "div_content", { data: res });
        },
        inittemp(tempid, _id, data) {
            var html = template(tempid, data);
            $("#" + _id).html(html);
        },
        /***
         * 去掉小数点后面无效零
         */
        getRegexNumber(data) {
            const regexp = /(?:\.0*|(\.\d+?)0+)$/
            return data.replace(regexp, '$1')
        },

    });


</script>

<script type="text/template" id="tplrecord">
<div class="weui-cells__title">
    <div class="weui-flex">
        <div class="weui-flex__item">病人： {{data.PatName}}</div>
        <div class="weui-flex__item">卡号： {{data.CardNum}}</div>
    </div>
    <div class="weui-flex">
        <div class="weui-flex__item">开方医生： {{data.DoctName}}</div>
        <div class="weui-flex__item">开方科室： {{data.DeptName}}</div>
    </div>
    <div class="weui-flex">
        <div class="weui-flex__item">方号：{{data.Feeno}}</div>
        <div class="weui-flex__item">开方时间： {{data.PresDate}}</div>
    </div>

</div>
<div class="weui-cells" style="margin-top:0">
{{each data.Items items1 }}

    <div class="weui-cell page-hd-desc">
        <div class="weui-cell__bd">
            <p>{{items1.ItemName}}</p>
        </div>
        <div class="weui-cell__hd">
            <p>{{items1.UnitPrice}} x {{items1.Quantity}}</p>
        </div>
    </div>

{{/each}}
</div>
<div class="weui-flex">
    <div class="weui-flex__item" style="display: flex;justify-content: flex-end; color:#FF6600;padding-right:15px;">￥ {{data.Fee}}元
    </div>
</div>
</script>